package com.example.applications.Kotlin

fun main() {
    println(getString("Kobi Drink"))

    println(getSum(1, 2))

    printString("Kobi Drink", "Messi Drink")

    println(getDouble(1, 2, 3))

}

//一个参数，输入字符串，返回该字符串
fun getString(str: String): String {
    return str
}

//输入两个数字，返回两个数字的和
fun getSum(a: Int, b: Int): Int {
    return a + b
}

//输入任意个数的字符串，并打印
fun printString(vararg str: String) {
    for (s in str) {
        println(s)
    }
}

//输入数字数组，将其映射成双倍
fun getDouble(vararg a: Int): List<Int> {
    return a.map { it * 2 }
}